package com.ecable.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import java.util.Vector;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ecable.bean.DistrictTO;
import com.ecable.bean.ProfileTO;
import com.ecable.bean.StateTO;
import com.ecable.delegate.DistrictMgrDelegate;
import com.ecable.delegate.StateMgrDelegate;
import com.ecable.exception.ConnectionException;
import com.ecable.exception.DataNotFoundException;
import com.ecable.formbean.StateFormBean;
import com.ecable.util.UtilConstants;
import com.sun.org.apache.commons.beanutils.BeanUtils;

public class RegisterPersonalAction extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6635069642812640760L;


	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		HttpSession session=request.getSession();
	          
		boolean flag=false;
		
		String path="";
		
		StateFormBean sfb=new StateFormBean();
		ProfileTO pr=new ProfileTO();
		pr.setLoginID(request.getParameter("userName"));
		pr.setPassword(request.getParameter("password"));
		pr.setLogintype(request.getParameter("UserType"));
		pr.setSquest(request.getParameter("squest"));
		pr.setOwnquest(request.getParameter("ownquest"));
		pr.setSecretAnswer(request.getParameter("secrete"));
		pr.setFirstName(request.getParameter("firstName"));
		pr.setLastName(request.getParameter("lastName"));
		pr.setBirthDate(request.getParameter("dob"));
		pr.setPhoto(request.getParameter("photo"));
		pr.setEmail(request.getParameter("email"));
		pr.setFax(request.getParameter("fax"));
		
		
			session.setAttribute("p", pr);
			
			path=UtilConstants._REG_ADDRESS_STATE;
			
	 response.sendRedirect(path);
			//rd=request.getRequestDispatcher(path);
	//rd.forward(request, response);

}

}
